(1) Field of the Invention
This invention relates to a cache control program for performing cache processes on data and a computer for performing cache processes, and, more particularly, to a cache control program and computer for performing cache processes involving reading data contained in a file of large size in sequential order.
(2) Description of the Related Art
A disk cache in a computer system is a mechanism for high-speed access to secondary storage devices, such as magnetic disk storage. When a computer which performs a disk cache process reads data, it reads out the data once to a cache area in a memory (main memory) and then transfers the data from the cache area to a requester. If the computer reads out the same data repeatedly, it reads out the data from the cache area in the memory. That is to say, the computer need only read the data from the cache area from the second time on. As a result, the number of times the computer accesses a secondary storage device can be reduced. Memories can be accessed more quickly than secondary storage devices, so high-speed access to data will be realized.
A cache area in a memory is limited. Therefore, when a computer reads new data after data being stored in the whole of a cache area, the computer specifies a section of the cache area to be reused and deletes data stored in this section. Then the computer transfers read data to the section in the cache area to be reused.
If a higher cache hit ratio (probability that data to be read will already exist in a cache area) is desired, a section which holds data accessed later with a low probability (with low frequency) must be selected as a section in the cache area to be reused. However, whether there is a possibility that data stored in each section in a cache area is used soon cannot necessarily be judged. Therefore, usually sections in a cache area are used in descending order of time which elapsed after the last access to data.
However, longer elapsed time after the last access to data does not necessarily mean that the frequency of access to the data is lower. In some cases, therefore, a cache hit ratio cannot be improved significantly only by the above method.
For example, if a request to read/write a file of large size which contains image data and voice data is issued, the file of large size will occupy a good portion of a cache area. In this case, a large amount of data previously stored in the cache area will become invalid and a cache hit ratio will remain low for a certain period of time after that. Moreover, if a file of large size is read into a cache area from the head, the leading data will be deleted first from the cache area. As a result, next time that file is read, a cache hit does not occur at the time of beginning to read the file and it takes time to open the file.
Furthermore, animation data and voice data are generally reproduced with a computer recently and the process of reading a file of large size is frequently performed. Unlike executable programs, it is rare for animation data and voice data to be read repeatedly in a short period of time. That is to say, though the frequency of access is low, a large amount of data is read into a cache area. This means that a cache area is consumed wastefully.